<?php

namespace App\Http\Controllers\Estate;

use App\Http\Controllers\Controller;
use App\Models\IntegralGoods;
use App\Models\IntegralLog;
use App\Models\Store;
use APP\Models\StoresCate;
use App\Services\IntegralLogService;
use Illuminate\Http\Request;

/**
 * 积分设置
 * Class IntegralSetController
 * @package App\Http\Controllers\Estate
 */
class IntegralLogController extends Controller
{

    /**
     * @param Request $request
     * @return array
     */
    public function index(Request $request)
    {
        $list = IntegralLogService::getLogList();
        return $this->success($list);
    }

    /**
     * @param IntegralLog $log_model
     * @param $id
     * @return array
     */
    public function destroy(IntegralLog $log_model, $id)
    {
        $idArray = array_filter(explode(',', $id), function ($item) {
            return is_numeric($item);
        });
        $log_model->destroy($idArray);
        return $this->success([], __('base.success'));
    }

}

